<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta charset="utf-8">
		<title>驴妈妈慧眼系统</title>
		<meta name="description" content="overview &amp; stats">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/bootstrap.css">
		<link rel="stylesheet" href="${request.contextPath}/static/assets/font-awesome/4.5.0/css/font-awesome.min.css">
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/daterangepicker.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/jquery.css">
		<!-- text fonts -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/fonts.css">
		<!-- ace styles -->
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style">
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-skins.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-rtl.min.css">
		<link rel="stylesheet" href="${request.contextPath}/static/stylesheets/tips.css">
		<!-- ace settings handler -->
		<script src="${request.contextPath}/static/assets/js/ace-extra.min.js"></script><style>@keyframes nodeInserted{from{outline-color:#fff}to{outline-color:#000}}@-moz-keyframes nodeInserted{from{outline-color:#fff}to{outline-color:#000}}@-webkit-keyframes nodeInserted{from{outline-color:#fff}to{outline-color:#000}}@-ms-keyframes nodeInserted{from{outline-color:#fff}to{outline-color:#000}}@-o-keyframes nodeInserted{from{outline-color:#fff}to{outline-color:#000}}.ace-save-state{animation-duration:10ms;-o-animation-duration:10ms;-ms-animation-duration:10ms;-moz-animation-duration:10ms;-webkit-animation-duration:10ms;animation-delay:0s;-o-animation-delay:0s;-ms-animation-delay:0s;-moz-animation-delay:0s;-webkit-animation-delay:0s;animation-name:nodeInserted;-o-animation-name:nodeInserted;-ms-animation-name:nodeInserted;-moz-animation-name:nodeInserted;-webkit-animation-name:nodeInserted}</style>
		<link rel="stylesheet" href="${request.contextPath}/static/assets/css/bsie-paginator.css">
		<script src="${request.contextPath}/static/assets/js/jquery-2.1.4.min.js"></script>
		<style type="text/css">
			#linkRemind{
				width:400px
			}
			#commodityShow{
				width:1000px
			}
			#priceGraph{
			width:800px
			}
			#innerdiv::-webkit-scrollbar{ display: none;}
			/* 模态框居中样式 */
			 .modal-dialog {
			 	top:40px;
			 }
			 .detail-row td{background-color:#f3f0eb!important}
			 .detailHead th {background-color:#abc6e2!important;color:#fff;}
			 .detail-commodity td{background-color:#f3f0eb!important}
			 .detail-commodity th {background-color:#abc6e2!important;color:#fff;}
			 ::-webkit-scrollbar{ display: none;}
		</style>
	</head>
	<body class="skin-2" style="background-color: #FFF;">
		<div class="page-content">
			<div class="tabbable">
				<div class="tab-content">
				   <div id="manage" class="tab-pane active in">
						<div class="row">
							<div class="col-xs-12">
								<div class="widget-box">
									<div class="widget-body" style="background-color: #EFF3F8;">
										<div class="widget-main">
											<input type="hidden" id="priceRange" name="priceRange" value="<#if priceRange??>${priceRange}</#if>">
											<input type="hidden" id="setAdLowestProductId" name="setAdLowestProductId" value="">
											<form class="form-inline" id="searchForm" method="post" action="${request.contextPath}/datashow/show_list">
											<input type="hidden" id="_csrf" name="${_csrf.parameterName}" value="${_csrf.token}"/>
											<#if productConditionVO??>
												<div class="form-group">
													<label  for="exampleInputName">产品ID
														<input class="form-control" name="productId" id="productIdVO" value="<#if productConditionVO.productId??>${productConditionVO.productId}</#if>" placeholder="模糊查询产品ID" type="text" style="width:123px">
													</label>
													<label  for="exampleInputName" style="margin-left: 30px;">产品名称
														<input class="form-control" name="sceneryName" id="sceneryNameVO" value="<#if productConditionVO.sceneryName??>${productConditionVO.sceneryName}</#if>" placeholder="模糊查询产品名称" type="text" style="width:123px">
													</label>
													<label  for="exampleInputName" style="margin-left: 30px;">所属城市
														<input class="form-control" name="cityCode" id="cityCodeVO" value="<#if productConditionVO.cityCode??>${productConditionVO.cityCode}</#if>" placeholder="模糊查询所属城市" type="text" style="width:123px">
													</label>
													<label  for="exampleInputName" style="margin-left: 30px;">产品星级
														<input class="form-control" name="starLevel" id="starLevelVO"value="<#if productConditionVO.starLevel??>${productConditionVO.starLevel}</#if>" placeholder="模糊查询产品星级" type="text" style="width:123px">
													</label>
													<label  for="exampleInputName" style="margin-left: 30px;">业务编码
														<select name="businessCode" id="businessCodeSearch" aria-controls="dynamic-table" class="form-control input-sm" style="width:80px;height:34px">
														      <#if productConditionVO??&&productConditionVO.businessCode??&&productConditionVO.businessCode=="TICKET"><option value="TICKET" selected>门票</option><#else><option value="TICKET">门票</option></#if>
														      <#if productConditionVO??&&productConditionVO.businessCode??&&productConditionVO.businessCode=="HOTEL"><option value="HOTEL" selected>酒店</option><#else><option value="HOTEL">酒店</option></#if>
														</select>
													</label>
													<button type="submit" class="btn btn-pink btn-sm" id="search">
														<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
														查询
													</button>
												</div>
											</#if>
											</form>	
										</div>
									</div>
								</div>
							</div>	
							
							<div class="col-xs-12">
								<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dynamic-table_info">
									<thead>
										<tr>
											<th>No.</th>
											<th>产品ID</th>
											<th>产品名称</th>
											<th>所属城市</th>
											<th>产品星级</th>
											<th>产品价格</th>
											<th>XC
												<label class="help_img">
													<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
													<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
												</label>
											</th>
											<th>TN
												<label class="help_img">
													<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
													<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
												</label>
											</th>
											<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
											<th>TC
												<label class="help_img">
													<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
													<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
												</label>
											</th>
											<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
											<th>EL
												<label class="help_img">
													<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
													<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
												</label>
											</th>
											</#if>
											<th>QNR
												<label class="help_img">
													<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
													<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
												</label>
											</th>
											<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
												<th>MT <!-- 美团列-->
													<label class="help_img">
														<i class="blue ace-icon fa fa-question-circle" style="color:#d6487e!important;"></i>
														<span class='tips'>黑色:价格与LMM相同；蓝色:价格差距在10%及以内；红色:低于LMM10%；绿色：高于LMM10%<s></s></span>
													</label>

												</th>
											</#if>
											<th>详情</th>
											<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
											<th>产品分析</th>
											</#if>
											<th>商品列表</th>
										</tr>
									</thead>
									<#if tprodList??&&tprodList?size&gt;0>
									<#list tprodList as prod>
										<tbody id="<#if prod.prod_id??>${prod.prod_id}</#if>">
											<tr class="productDetail">
												<td>${prod_index + 1}</td>
												<td class="tdProductId"><#if prod.prod_id??>${prod.prod_id}</#if></td>
												<td class="tdSceneryName"><#if prod.scenery_name??>${prod.scenery_name}</#if></td>
												<td><#if prod.city_code??>${prod.city_code}</#if></td>
												<td><#if prod.star_level??>${prod.star_level}<#else>暂无星级评定</#if></td>
												<td class="lmm"><strong><#if prod.lowest_price??&&prod.lowest_price!="">￥${prod.lowest_price}</#if></strong></td>
												<td class="xc"><strong>
													<#if prod.lowest_price_xc??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_xc!=""&&prod.lowest_price!="">
														<#if (prod.lowest_price_xc?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_xc?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price?number!=prod.lowest_price_xc?number>
															<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_xc}</div>
														<#elseif prod.lowest_price?number==prod.lowest_price_xc?number>
															<div>￥${prod.lowest_price_xc}</div>
														<#elseif (prod.lowest_price_xc?number>(prod.lowest_price?number*(priceRange+1)))>
															<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_xc}↑</div>
														<#else>
															<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_xc}↓</div>
														</#if>
													<#else>
														<#if prod.lowest_price_xc??&&prod.lowest_price_xc!=""><div>￥${prod.lowest_price_xc}</div></#if>
														</#if>
													</strong>
												</td>
												<td class="tn"><strong>
													<#if prod.lowest_price_tn??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_tn!=""&&prod.lowest_price!="">
														<#if (prod.lowest_price_tn?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_tn?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price?number!=prod.lowest_price_tn?number>
															<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_tn}</div>
														<#elseif prod.lowest_price?number==prod.lowest_price_tn?number>
															<div>￥${prod.lowest_price_tn}</div>
														<#elseif (prod.lowest_price_tn?number>(prod.lowest_price?number*(priceRange+1)))>
															<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_tn}↑</div>
														<#else>
															<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_tn}↓</div>
														</#if>
													<#else>
														<#if prod.lowest_price_tn??&&prod.lowest_price_tn!=""><div>￥${prod.lowest_price_tn}</div></#if>
														</#if>
													</strong>
												</td>

												<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
												<td class="tc"><strong>
														<#if prod.lowest_price_tc??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_tc!=""&&prod.lowest_price!="">
															<#if (prod.lowest_price_tc?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_tc?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price_tc?number!=prod.lowest_price?number>
																<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_tc}</div>
															<#elseif prod.lowest_price_tc?number==prod.lowest_price?number>
																<div>￥${prod.lowest_price_tc}</div>
															<#elseif (prod.lowest_price_tc?number>(prod.lowest_price?number*(priceRange+1)))>
																<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_tc}↑</div>
															<#else>
																<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_tc}↓</div>
															</#if>
														<#else>
															<#if prod.lowest_price_tc??&&prod.lowest_price_tc!=""><div>￥${prod.lowest_price_tc}</div></#if>
														</#if>
														</strong>
												</td>

												<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
												<td class="el"><strong>
												<#if prod.lowest_price_el??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_el!=""&&prod.lowest_price!="">
												<#if (prod.lowest_price_el?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_el?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price_el?number!=prod.lowest_price?number>
												<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_el}</div>
												<#elseif prod.lowest_price_el?number==prod.lowest_price?number>
												<div>￥${prod.lowest_price_el}</div>
												<#elseif (prod.lowest_price_el?number>(prod.lowest_price?number*(priceRange+1)))>
												<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_el}↑</div>
												<#else>
												<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_el}↓</div>
												</#if>
												<#else>
												<#if prod.lowest_price_el??&&prod.lowest_price_el!=""><div>￥${prod.lowest_price_el}</div></#if>
												</#if>
												</strong></td>
												</#if>

												<td class="qnr">
												<strong>
												<#if prod.lowest_price_qnr??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_qnr!=""&&prod.lowest_price!="">
												<#if (prod.lowest_price_qnr?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_qnr?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price_qnr?number!=prod.lowest_price?number>
												<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_qnr}</div>
												<#elseif prod.lowest_price_qnr?number==prod.lowest_price?number>
												<div>￥${prod.lowest_price_qnr}</div>
												<#elseif (prod.lowest_price_qnr?number>(prod.lowest_price?number*(priceRange+1)))>
												<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_qnr}↑</div>
												<#else>
												<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_qnr}↓</div>
												</#if>
												<#else>
												<#if prod.lowest_price_qnr??&&prod.lowest_price_qnr!=""><div>￥${prod.lowest_price_qnr}</div></#if>
												</#if>
												</strong>
												</td>

												<!-- 新增美团 -->
												<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<td class="mt">
														<strong>
															<#if prod.lowest_price_mt??&&priceRange??&&prod.lowest_price??&&prod.lowest_price_mt!=""&&prod.lowest_price!="">
																<#if (prod.lowest_price_mt?number<=(prod.lowest_price?number*(priceRange+1)))&&(prod.lowest_price_mt?number>=(prod.lowest_price?number*(1-priceRange)))&&prod.lowest_price_mt?number!=prod.lowest_price?number>
																<div style="background-color:#67aef5;color:#fff;">￥${prod.lowest_price_mt}</div>
																<#elseif prod.lowest_price_mt?number==prod.lowest_price?number>
																	<div>￥${prod.lowest_price_mt}</div>
																	<#elseif (prod.lowest_price_mt?number>(prod.lowest_price?number*(priceRange+1)))>
																		<div style="background-color:#84db56;color:#fff;">￥${prod.lowest_price_mt}↑</div>
																		<#else>
																			<div style="background-color:#ed6d5c;color:#fff;">￥${prod.lowest_price_mt}↓</div>
															</#if>
															<#else>
																<#if prod.lowest_price_mt??&&prod.lowest_price_mt!=""><div>￥${prod.lowest_price_mt}</div></#if>
																</#if>
														</strong>
													</td>
												</#if>
												<td class="center">
													<div class="action-buttons show-details-btn" style="cursor:pointer;">
														<a class="green bigger-140" title="Show Details"><!-- 主界面详情 通过给class show-details-btn 设置点击事件-->
															<i class="ace-icon fa fa-angle-double-down"></i>
															<span class="sr-only">Details</span>
														</a>
													</div>
												</td>
												<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
												<td align='center'>
													<div class="hidden-sm hidden-xs action-buttons" style="cursor:pointer;" onclick='skipToScreenDemo(this);'>
													<a class='blue' role='button'> 
															<i class="ace-icon fa fa-search-plus bigger-130"></i>
														</a>
													</div>
												</td>
												</#if>
												<td align='center'>
													<div class="hidden-sm hidden-xs action-buttons" style="cursor:pointer;"  onclick='skipToCommodity(this);'>
													 <a class='blue' role='button'> 
															<i class="ace-icon fa fa-search-plus bigger-130"></i>
														</a>
													</div>
												</td>
											</tr>
											</tbody>
											<tbody class="detail-row" data-show="1" style='display:none' align='center'>
												<tr class='detailHead'>
													<th colspan="2"><strong>属性</strong></th>
													<th colspan="2"><strong>LMM</strong></th>
													<th colspan="2" ><strong>XC</strong></th>
													<th colspan="2" ><strong>TN</strong></th>
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<th colspan="2"><strong>TC</strong></th>
													<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
													<th colspan="2"><strong>EL</strong></th>
													</#if>
													<th colspan="3"><strong>QNR</strong></th>
													<!-- 增加美团-->
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
														<th colspan="3"><strong>MT</strong></th>
													</#if>
												</tr>
												
												<tr>
													<td  rowspan="4"><strong>详情</strong></td>
													<td style='background-color:#fff' align='center'><strong>产品名称</strong></td>
													<td colspan="2" ><#if prod.scenery_name??>${prod.scenery_name}</#if></td>
													<td colspan="2"><#if prod.scenery_name_xc??>${prod.scenery_name_xc}</#if></td>
													<td colspan="2"><#if prod.scenery_name_tn??>${prod.scenery_name_tn}</#if></td>
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<td colspan="2"><#if prod.scenery_name_tc??>${prod.scenery_name_tc}</#if></td>
													<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
													<td colspan="2"><#if prod.scenery_name_el??>${prod.scenery_name_el}</#if></td>
													</#if>
													<td colspan="3"><#if prod.scenery_name_qnr??>${prod.scenery_name_qnr}</#if></td>
													<!-- 新增美团-->
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
														<td colspan="3"><#if prod.scenery_name_mt??>${prod.scenery_name_mt}</#if></td>
													</#if>
												</tr>
												<tr>
													<td style='background-color:#fff' align='center'><strong>评分</strong></td>
													<td colspan="2" ><#if prod.score??>${prod.score}</#if></td>
													<td colspan="2" ><#if prod.score_xc??>${prod.score_xc}</#if></td>
													<td colspan="2"><#if prod.score_tn??>${prod.score_tn}</#if></td>
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<td colspan="2"><#if prod.score_tc??>${prod.score_tc}</#if></td>
													<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
													<td colspan="2"><#if prod.score_el??>${prod.score_el}</#if></td>
													</#if>
													<td colspan="3"><#if prod.score_qnr??>${prod.score_qnr}</#if></td>
													<!-- 新增美团-->
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
														<td colspan="3"><#if prod.score_mt??>${prod.score_mt}</#if></td>
													</#if>
												</tr>	
												<tr>
													<td><strong>快照</strong></td>
													<td colspan="2">无快照</td>
													<td colspan="2"><#if prod.snapshot_addr_xc??><a class="pimg" name="${prod.snapshot_addr_xc}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_xc??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_xc}' target="_blank">详情链接</a></#if>  --></td>
													<td colspan="2"><#if prod.snapshot_addr_tn??><a class="pimg" name="${prod.snapshot_addr_tn}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_tn??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_tn}' target="_blank">详情链接</a></#if>  --></td>
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<td colspan="2"><#if prod.snapshot_addr_tc??><a class="pimg" name="${prod.snapshot_addr_tc}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_tc??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_tc}' target="_blank">详情链接</a></#if>  --></td>
													<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
													<td colspan="2"><#if prod.snapshot_addr_el??><a class="pimg" name="${prod.snapshot_addr_el}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_tc??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_tc}' target="_blank">详情链接</a></#if>  --></td>
													</#if>
													<td colspan="3"><#if prod.snapshot_addr_qnr??><a class="pimg" name="${prod.snapshot_addr_qnr}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_qnr??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_qnr}' target="_blank">详情链接</a></#if>  --></td>
													<!-- 新增美团--->
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
														<td colspan="3"><#if prod.snapshot_addr_mt??><a class="pimg" name="${prod.snapshot_addr_mt}" style='cursor:pointer;'><span class='glyphicon glyphicon-camera'></span></a></#if><!--<#if prod.detail_url_qnr??>&nbsp&nbsp&nbsp&nbsp&nbsp<a href='${prod.detail_url_qnr}' target="_blank">详情链接</a></#if>  --></td>
													</#if>
												</tr>
												<tr>
													<td><strong>详情链接</strong></td>
													<td colspan="2"><#if prod.detail_url??&&prod.detail_url?length&gt;5>${prod.detail_url?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url??>${prod.detail_url}</#if></td>
													<td colspan="2"><#if prod.detail_url_xc??&&prod.detail_url_xc?length&gt;5>${prod.detail_url_xc?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_xc}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_uc??>${prod.detail_url_xc}</#if></td>
													<td colspan="2"><#if prod.detail_url_tn??&&prod.detail_url_tn?length&gt;5>${prod.detail_url_tn?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_tn}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url_tn??>${prod.detail_url_tn}</#if></td>
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
													<td colspan="2"><#if prod.detail_url_tc??&&prod.detail_url_tc?length&gt;5>${prod.detail_url_tc?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_tc}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url_tc??>${prod.detail_url_tc}</#if></td>
													<#elseif productConditionVO.businessCode??&&productConditionVO.businessCode=='HOTEL'>
													<td colspan="2"><#if prod.detail_url_el??&&prod.detail_url_el?length&gt;5>${prod.detail_url_el?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_el}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url_el??>${prod.detail_url_el}</#if></td>
													</#if>
													<td colspan="3"><#if prod.detail_url_qnr??&&prod.detail_url_qnr?length&gt;5>${prod.detail_url_qnr?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_qnr}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url_qnr??>${prod.detail_url_qnr}</#if></td>	
													<!-- 新增美团-->
													<#if productConditionVO.businessCode??&&productConditionVO.businessCode=='TICKET'>
														<td colspan="3"><#if prod.detail_url_mt??&&prod.detail_url_mt?length&gt;5>${prod.detail_url_mt?substring(0,5)}...<a onclick="showDetailUrl(this);" class="${prod.detail_url_mt}" style='cursor:pointer;'><i class="ace-icon fa fa-eye"></i></a><#elseif prod.detail_url_mt??>${prod.detail_url_mt}</#if></td>
													</#if>
												</tr>
											</tbody>
									</#list>
									</#if>
								</table>
								<#include "paginator.html">
							 </div>
						 </div>
					</div>
				 </div>
								
					<!-- 提醒关联产品 -->
					<button class="btn btn-info" data-toggle="modal" type="button" style="display:none;" id="linkForm" data-target="#linkModal"></button>
					<div class="modal fade" id="linkModal" tabindex="-1" role="dialog" aria-labelledby="linkModalLabel" aria-hidden="true">
						<div class="modal-dialog link" id="linkRemind">
							<div class="modal-content">
								<div class="modal-header" style="height:20px">
						            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" id='close1' style="height:10px;line-height:5px">
						                  <small>×</small>
						            </button>
						            
					         	</div>
					         	<div class="modal-body">
					         		<strong style='padding-left:120px'>请先关联商品！</strong>	 
					         	</div>
					         	<div class="modal-footer" style="height:50px">
					         		<button type="button" class="btn btn-primary" data-dismiss="modal" style="height:30px;line-height:10px">
						              	 确定
						            </button>
					         	</div>
							</div>
						</div>
					</div>
						
					<!-- 用来展示商品的弹框 -->
					<button class="btn btn-info" data-toggle="modal" type="button" style="display:none;" id="showCommodity" data-target="#commodityModal"></button>
					<div class="modal fade" id="commodityModal" tabindex="-1" role="dialog" aria-labelledby="commodityModalLabel" aria-hidden="true">
						<div class="modal-dialog link" id="commodityShow">
							<div class="modal-content">
								<div class="modal-header" style="height:50px">
								
						            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" id='close1' style="line-height:10px">
						                  <small>×</small>
						            </button>
						             <h4 style="line-height:0px"> 商品展示</h4>
					         	</div>
					         	<div class="modal-body">
					         		<div id="commodityDetail"> </div>	 
					         	</div>
					         	<div class="modal-footer" style="height:50px">
					         		<button type="button" class="btn btn-primary" data-dismiss="modal" style="height:30px;line-height:10px">
						              	 确定
						            </button>
					         	</div>
							</div>
						</div>
					</div>
					
					<div class="row">
						<div class="col-xs-12">
							<button class="btn btn-info" data-toggle="modal" type="button" style="display:none;" id="update" data-target="#myModal"></button>
							<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
								   <div class="modal-dialog" id="priceGraph">
								      <div class="modal-content">
								         <div class="modal-header">
								            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
								                  ×
								            </button>
											选择时段:<label ><input type="text" id="config-demo" name="chooseTimeVO" class="form-control time" style="width:200px;height:32px;"></label>
											<button id="app_search" type="button"  onclick="replaceDate('7');" class="btn btn-white btn-sm">
											<span class="ace-icon icon-on-right bigger-110"></span>
												过去7天
											</button>
											<button id="app_search" type="button"  onclick="replaceDate('31');" class="btn btn-white btn-sm">
												<span class="ace-icon icon-on-right bigger-110"></span>
												过去31天
											</button>
											<button id="ajax_search" type="button" class="btn btn-pink btn-sm" onclick="searchData();">
												<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
												Search
											</button>
								         </div>
								         <div class="modal-body">
								         	<div id="main" style="width: 750px;height:350px"></div>
								         </div>
							     	</div>
								  </div>
							</div>
						</div>
					</div>
					
					<div class="row">
					 <div class="col-xs-12">
						<button class="btn btn-info" data-toggle="modal" type="button"
							style="display: none;" id="detailUrl" data-target="#myModalUrl">
						</button>
							<div class="modal fade" id="myModalUrl" tabindex="-1" role="dialog"
								aria-labelledby="myModalLabel" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content" style="width:800px; height:250px">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">×</button>
											<h4 class="modal-title" id="myModalLabel"><strong>详情链接</strong></h4>
										</div>
										<div class="modal-body" id="productUrlDetail" style='word-break:break-all;'>
										</div>
									</div>
									<!-- /.modal-content -->
								</div>
								<!-- /.modal -->
							</div>
					</div>
				</div>
				<!--是否sewe -->
				<button class="btn btn-info" data-toggle="modal" type="button" style="display:none;" id="deleteForm" data-target="#deleteModal">
						</button>
				<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
				<input type="hidden" id="prodNameOther" name="prodNameOther"/>
				<input type="hidden" id="prodIdOther" name="prodIdOther"/>
				<input type="hidden" id="delCompanyCode" name="delCompanyCode"/>
				<input type="hidden" id="delProdId" name="delProdId"/>
				<div class="modal-dialog link" id="deleteRemind">
					<div class="modal-content">
						<div class="modal-header" style="height:40px">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" id='close1' style="height:10px;line-height:5px">
				                  <small>×</small>
				            </button>
				            <strong style="height:10px;line-height:5px;font-size:15px" id="deleteTitle">是否确认删除关联？</strong>
			         	</div>
			         	<div class="modal-body">
			         			 <span style="color:red;padding-left:50px">确认会同时删除该产品所有的商品关联！</span>
			         	</div>
			         	<div class="modal-footer" style="height:50px">
			         		<button type="button" class="btn btn-default" data-dismiss="modal" style="height:30px;line-height:10px">
						    	取消
						    </button>
			         		<button type="button" class="btn btn-primary" data-dismiss="modal" style="height:30px;line-height:10px" id="confirmDelete">
				              	 确定
				            </button>
			         	</div>
					</div>
					</div>
					</div>
				</div>
			</div>
		<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;"><div id="innerdiv" style="position:absolute;top:50%;left:50%;transform: translate(-50%,-50%);-webkit-transform: translate(-50%,-50%);overflow-y:scroll;height:100%;padding: 10px 0;"><img id="bigimg" style="border:5px solid #fff;width:100%" src="" /></div></div>
		<input type="hidden" id="showlistcontext" value="${request.contextPath}"/>
		<input type="hidden" id="commodityId" value=""/>
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) 
				document.write("<script src='${request.contextPath}/static/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
				
		<script src="${request.contextPath}/static/assets/js/bootstrap.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/jquery-ui.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/bootbox.js"></script>
		<script src="${request.contextPath}/static/assets/js/spin.js"></script>
		<!-- ace scripts -->
		<script src="${request.contextPath}/static/assets/js/ace-elements.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/ace.min.js"></script>
		<!-- validator scripts -->
		<script src="${request.contextPath}/static/assets/js/bootstrapValidator.min.js"></script>
		<!-- user scripts -->
		<script src="${request.contextPath}/static/assets/js/user/base.js"></script>
		<script src="${request.contextPath}/static/assets/js/moment.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/daterangepicker.min.js"></script>
		<script src="${request.contextPath}/static/assets/js/echarts.min.js"></script>
		
		<script type="text/javascript">
		//$("#myModal").draggable();
		//$(".modal-dialog").draggable();
		//图片放大
		$(function(){
			$(".pimg").click(function(){
			var _this = $(this);//将当前的pimg元素作为_this传入函数
			imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);
			});
			});
		function imgShow(outerdiv, innerdiv, bigimg, _this){
			var src = _this.attr("name");//获取当前点击的pimg元素中的src属性
			$(bigimg).attr("src", src);//设置#bigimg元素的src属性
			/*获取当前点击图片的真实大小，并显示弹出层及大图*/
			$("<img/>").attr("src", src).load(function(){
			var windowW = $(window).width();//获取当前窗口宽度
			var windowH = $(window).height();//获取当前窗口高度
			var realWidth = this.width;//获取图片真实宽度
			var realHeight = this.height;//获取图片真实高度
			var imgWidth, imgHeight;
			var scale = 0.99;//缩放尺寸，当图片真实宽度和高度大于窗口宽度和高度时进行缩放
			 
			if(realHeight>windowH*scale) {//判断图片高度
			imgHeight = windowH*scale;//如大于窗口高度，图片高度进行缩放
			imgWidth = imgHeight/realHeight*realWidth;//等比例缩放宽度
			if(imgWidth>windowW*scale) {//如宽度扔大于窗口宽度
			imgWidth = windowW*scale;//再对宽度进行缩放
			}
			} else if(realWidth>windowW*scale) {//如图片高度合适，判断图片宽度
			imgWidth = windowW*scale;//如大于窗口宽度，图片宽度进行缩放
			imgHeight = imgWidth/realWidth*realHeight;//等比例缩放高度
			} else {//如果图片真实高度和宽度都符合要求，高宽不变
			imgWidth = realWidth;
			imgHeight = realHeight;
			}
			//$(bigimg).css("width",imgWidth);//以最终的宽度对图片缩放
			//$(bigimg).css("overflow","auto");
			var w = (windowW-imgWidth)/2;//计算图片与窗口左边距
			var h = (windowH-imgHeight)/4;//计算图片与窗口上边距
			//$(innerdiv).css({"top":h, "left":w});//设置#innerdiv的top和left属性
			$(outerdiv).fadeIn("fast");//淡入显示#outerdiv及.pimg
			});
			 
			$(outerdiv).click(function(){//再次点击淡出消失弹出层
			$(this).fadeOut("fast");
			});
			}
			
		</script>
		<script type="text/javascript">
		var showlistcontext = $("#showlistcontext").val();
		var showDetailUrl=function(obj){
			url=$(obj).attr('class');
			$("#productUrlDetail").text("");
			$("#productUrlDetail").text(url);
			$("#detailUrl").click();
		}
			jQuery(function($) {		
				$('.show-details-btn').on('click', function(e) {
					e.preventDefault();
					productId=$(this).parents("tr.productDetail").find("td.tdProductId").text().trim();
					businessCode=$("#businessCodeSearch").val();
					$.ajax({
					url : showlistcontext+'/datashow/productPriceHistory',
					type : "GET",
					data : {
						productId:productId,
						businessCode:businessCode
					},
					success:function(data){
						if(data.sessionStatus==540){//异步请求session过期状态
							window.location.href=showlistcontext+"/login";
							return;
						}else{
							lmmData=data.lmmList;
							xcData=data.xcList;
							tnData=data.tnList;
							tcData=data.tcList;
							qnrData=data.qnrList;
							elData=data.elList;
							mtData=data.mtList;//新增美团数据
							var trs="";
							if(lmmData!=null&&lmmData!=null){
								var flag=false;
								$.each(lmmData,function(n,value) {  
									
									trs+="<tr class='addHtml' colspan='2'>";
									if(lmmData.length==1&&flag==false){
										trs+="<td style='background-color:#EFF3F8'><strong>历史抓取</strong></td>";
										flag=true;
									}else if(lmmData.length==2&&flag==false){
										trs+="<td style='background-color:#EFF3F8' rowspan='2' ><strong>最新抓取（倒序）</strong></td>";
										flag=true;
									}else if(lmmData.length==3&&flag==false){
										trs+="<td style='background-color:#EFF3F8' rowspan='3' ><strong>最新抓取（倒序）</strong></td>";
										flag=true;
									}
									
									trs+="<td style='background-color:#EFF3F8'><strong>"+(n+1)+"</strong></td>";
									if(value.lowest_price!=null){
										trs += "<td colspan='2' align='center' style='background-color:#EFF3F8'>￥"+value.lowest_price+"</td>"; 
									}else if(value.lowestPrice!=null){
										trs += "<td colspan='2' align='center' style='background-color:#EFF3F8'>￥"+value.lowestPrice+"</td>"; 
									}else{
										trs += "<td colspan='2' align='center' style='background-color:#EFF3F8'></td>"; 
									}
									if(xcData!=null&&xcData.length>n){
										if(xcData[n].lowest_price!=null){
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+xcData[n].lowest_price+"</td>";
										}else if(xcData[n].lowestPrice!=null){
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+xcData[n].lowestPrice+"</td>";
										}else{
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
										}
									
									}else{
										  trs+="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
									}
									if(tnData!=null&&tnData.length>n){
										if(tnData[n].lowest_price!=null){
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+tnData[n].lowest_price+"</td>";
										}else if(tnData[n].lowestPrice!=null){
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+tnData[n].lowestPrice+"</td>";
										}else{
											trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
										}
									 }else{
										  trs+="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
									 }
									if(businessCode==""||businessCode=="TICKET"){
										if(tcData!=null&&tcData.length>n){
											if(tcData[n].lowest_price!=null){
												trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+tcData[n].lowest_price+"</td>";
											}else if(tcData[n].lowestPrice!=null){
												trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'> ￥"+tcData[n].lowestPrice+"</td>";
											}else{
												trs +="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
											}
											  
										  }else{
											  trs+="<td colspan='2' align='center' style='background-color:#EFF3F8'></td>";
										  }
									}
									
									 if(qnrData!=null&&qnrData.length>n){
										  if(qnrData[n].lowest_price!=null){
											  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+qnrData[n].lowest_price+"</td>";
										  }else if(qnrData[n].lowestPrice!=null){
											  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+qnrData[n].lowestPrice+"</td>";
										  }else{
											  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'></td>";
										  }
									  }else{
										  trs+="<td colspan='3' align='center' style='background-color:#EFF3F8'></td>";
									  }
									  //此处增加美团的产品历史详情
									if(businessCode=="TICKET"){
                                        if(mtData!=null&&mtData.length>n){
                                            if(mtData[n].lowest_price!=null){
                                                trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+mtData[n].lowest_price+"</td>";
                                            }else if(mtData[n].lowestPrice!=null){
                                                trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+mtData[n].lowestPrice+"</td>";
                                            }else{
                                                trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'></td>";
                                            }
                                        }else{
                                            trs+="<td colspan='3' align='center' style='background-color:#EFF3F8'></td>";
                                        }
									}

									 if(businessCode=="HOTEL"){
										 if(elData!=null&&elData.length>n){
											  if(elData[n].lowest_price!=null){
												  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+elData[n].lowest_price+"</td></tr>";
											  }else if(elData[n].lowestPrice!=null){
												  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'> ￥"+elData[n].lowestPrice+"</td></tr>";
											  }else{
												  trs +="<td colspan='3' align='center' style='background-color:#EFF3F8'></td></tr>";
											  }
										  }else{
											  trs+="<td colspan='3' align='center' style='background-color:#EFF3F8'></td></tr>";
										  }
									 }
									 
								 });  
							}
							addHtml=$("#"+productId).next().find(".addHtml");
							if(addHtml!=null){
								addHtml.remove();
							}
							$("#"+productId).next().append(trs);
							$("#"+productId).next().toggle();
						}
						
					}
				});
					$(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass('fa-angle-double-up');
				});
			})
			//商品列表
			skipToCommodity=function(obj){
				prod_id=$(obj).parents("tr").find(".tdProductId").text().trim();
				$("#setAdLowestProductId").val(prod_id);
				tdSceneryName=$(obj).parents("tr").find(".tdSceneryName").text().trim();
				priceRange=parseFloat($("#priceRange").val());
				businessCode=$("#businessCodeSearch").val();
				$.ajax({
					url : showlistcontext+'/datashow/show_product',
					type : "GET",
					data : {
						prod_id:prod_id,
						businessCode:businessCode
					},

					success:function(data){
						if(data.sessionStatus==540){//异步请求session过期状态
							window.location.href=showlistcontext+"/login";
							return;
						}else{
							if(data.number==0){//增加存在判断
								linkForm.click();
								//location.href="show_product?prodId="+prod_id+"&sceneryName="+tdSceneryName+"&pageNum="+$("#pageNum").val();
							}else{
								//先去掉之前的内容，以免页面中有重复值
								$("#commodityDetail div").remove();
								$("#showCommodity").click();
								commoditys=data.tcsvs;
								if(commoditys!=null&&commoditys!=null){
									var table="<div style='height:450px;width:950px;overflow:auto'><table class='table table-striped table-bordered table-hover dataTable no-footer' style='width: 950px'>";
									var thead=""
									if(businessCode==null||businessCode==""||businessCode=="TICKET"){//门票增加美团
										thead="<thead><th>商品名称</th><th>商品价格</th><th>XC</th><th>TN</th><th>TC</th><th>QNR</th><th>MT</th><th>详情</th><th>设为起价</th><th>历史价格</th></thead> <tbody>";
									}else if(businessCode="HOTEL"){
										thead="<thead><th>商品名称</th><th>商品价格</th><th>XC</th><th>TN</th><th>EL</th><th>QNR</th><th>MT</th><th>详情</th><th>历史价格</th></thead> <tbody>";
									}
									
									table+=thead;
									tbody="";
									$.each(commoditys,function(n,value){
										var trs="";
										var detailTrs="";
										trs+="<tr><td class='"+value.commodity_id+"'>"+value.commodity_name+"</td> <td><strong>￥"+value.sale_price+"</strong></td>";
										if(value.sale_price_xc!=null){
											if(value.sale_price_xc<=value.sale_price*(priceRange+1)&&value.sale_price_xc>=value.sale_price*(1-priceRange)&&Number(value.sale_price)!=Number(value.sale_price_xc)){
												trs+="<td style='color:blue' class='xcPrice'><strong>￥<span>"+value.sale_price_xc+"</span></strong></td>";
											}else if(Number(value.sale_price)==Number(value.sale_price_xc)){
												trs+="<td class='xcPrice'><strong>￥<span>"+value.sale_price_xc+"</span></strong></td>";
											}else if(value.sale_price_xc>value.sale_price*(priceRange+1)){
												trs+="<td style='color:green' class='xcPrice'><strong>￥<span>"+value.sale_price_xc+"</span>↑</strong></td>";
											}else{
												trs+="<td style='color:red' class='xcPrice'><strong>￥<span>"+value.sale_price_xc+"</span>↓</strong></td>";
											}
											
										}else{
											trs+="<td></td>";
										}
										if(value.sale_price_tn!=null){
											if(value.sale_price_tn<=value.sale_price*(priceRange+1)&&value.sale_price_tn>=value.sale_price*(1-priceRange)&&Number(value.sale_price)!=Number(value.sale_price_tn)){
												trs+="<td style='color:blue' class='tnPrice'><strong>￥<span>"+value.sale_price_tn+"</span></strong></td>";
											}else if(Number(value.sale_price)==Number(value.sale_price_tn)){
												trs+="<td class='tnPrice'><strong>￥<span>"+value.sale_price_tn+"</span></strong></td>";
											}else if(value.sale_price_tn>value.sale_price*(priceRange+1)){
												trs+="<td style='color:green' class='tnPrice'><strong>￥<span>"+value.sale_price_tn+"</span>↑</strong></td>";
											}else{
												trs+="<td style='color:red' class='tnPrice'><strong>￥<span>"+value.sale_price_tn+"↓</span></strong></td>";
											}
											
										}else{
											trs+="<td></td>";
										}
										if(value.sale_price_tc!=null){
											if(value.sale_price_tc<=value.sale_price*(priceRange+1)&&value.sale_price_tc>=value.sale_price*(1-priceRange)&&Number(value.sale_price)!=Number(value.sale_price_tc)){
												trs+="<td style='color:blue' class='tcPrice'><strong>￥<span>"+value.sale_price_tc+"</span></strong></td>";
											}else if(Number(value.sale_price)==Number(value.sale_price_tc)){
												trs+="<td class='tcPrice'><strong>￥<span>"+value.sale_price_tc+"</span></strong></td>";
											}else if(value.sale_price_tc>value.sale_price*(priceRange+1)){
												trs+="<td style='color:green' class='tcPrice'><strong>￥<span>"+value.sale_price_tc+"</span>↑</strong></td>";
											}else{
												trs+="<td style='color:red' class='tcPrice'><strong>￥<span>"+value.sale_price_tc+"</span>↓</strong></td>";
											}
											
										}else if(value.sale_price_el!=null){
											if(value.sale_price_el<=value.sale_price*(priceRange+1)&&value.sale_price_el>=value.sale_price*(1-priceRange)&&Number(value.sale_price)!=Number(value.sale_price_el)){
												trs+="<td style='color:blue' class='elPrice'><strong>￥<span>"+value.sale_price_el+"</span></strong></td>";
											}else if(Number(value.sale_price)==Number(value.sale_price_el)){
												trs+="<td class='elPrice'><strong>￥<span>"+value.sale_price_el+"</span></strong></td>";
											}else if(value.sale_price_el>value.sale_price*(priceRange+1)){
												trs+="<td style='color:green' class='elPrice'><strong>￥<span>"+value.sale_price_el+"</span>↑</strong></td>";
											}else{
												trs+="<td style='color:red' class='elPrice'><strong>￥<span>"+value.sale_price_el+"</span>↓</strong></td>";
											}
										}else{
											trs+="<td></td>";
										}
										if(value.sale_price_qnr!=null){
											if(value.sale_price_qnr<=value.sale_price*(priceRange+1)&&value.sale_price_qnr>=value.sale_price*(1-priceRange)&&Number(value.sale_price_qnr)!=Number(value.sale_price)){
												trs+="<td style='color:blue' class='qnrPrice'><strong>￥<span>"+value.sale_price_qnr+"</span></strong></td>";
											}else if(Number(value.sale_price_qnr)==Number(value.sale_price)){
												trs+="<td class='qnrPrice'><strong>￥<span>"+value.sale_price_qnr+"</span></strong></td>";
											}else if(value.sale_price_qnr>value.sale_price*(priceRange+1)){
												trs+="<td style='color:green' class='qnrPrice'><strong>￥<span>"+value.sale_price_qnr+"</span>↑</strong></td>";
											}else{
												trs+="<td style='color:red' class='qnrPrice'><strong>￥<span>"+value.sale_price_qnr+"</span>↓</strong></td>";
											}

										}else{
											trs+="<td></td>";
										}
										<!-- 增加美团-->
                                        if(value.sale_price_mt!=null){
                                            if(value.sale_price_mt<=value.sale_price*(priceRange+1)&&value.sale_price_mt>=value.sale_price*(1-priceRange)&&Number(value.sale_price_mt)!=Number(value.sale_price)){
                                                trs+="<td style='color:blue' class='mtPrice'><strong>￥<span>"+value.sale_price_mt+"</span></strong></td>";
                                            }else if(Number(value.sale_price_mt)==Number(value.sale_price)){
                                                trs+="<td class='mtPrice'><strong>￥<span>"+value.sale_price_mt+"</span></strong></td>";
                                            }else if(value.sale_price_mt>value.sale_price*(priceRange+1)){
                                                trs+="<td style='color:green' class='mtPrice'><strong>￥<span>"+value.sale_price_mt+"</span>↑</strong></td>";
                                            }else{
                                                trs+="<td style='color:red' class='mtPrice'><strong>￥<span>"+value.sale_price_mt+"</span>↓</strong></td>";
                                            }

                                        }else{
                                            trs+="<td></td>";
                                        }



										trs+="<td class='center' style='cursor:pointer;' onclick='showComDetailInfo(this);'><div class='action-buttons' ><a class='green bigger-140 show-details-btn' title='Show Details' id='commodityDetailInfo' ><i class='ace-icon fa fa-angle-double-down' ></i><span class='sr-only'>Details</span></a></div></td>";
										if(businessCode==null||businessCode==""||businessCode=="TICKET"){
											if(value.set_as_lowest==1){
												trs+="<td class='lowestPriceOrNot'><span class='alreadySet'>已设</span><span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a class='red' style='float:right' onclick='deleteLowest(this);'><i class='ace-icon fa fa-trash-o bigger-130'></i></a></span></td>";
											}else{
												trs+="<td class='lowestPriceOrNot'><span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a title='执行' class='green' onclick='setAsLowest(this);'role='button'  data-toggle='modal'><i class='ace-icon fa fa-check bigger-120'></i></a></span></td>"
											}
										}
										
										//历史价格表
										trs+="<td align='center' style='cursor:pointer;' onclick='showPriceList(this);'><span class='hidden-sm hidden-xs action-buttons' ><a class='blue'  role='button'><i class='ace-icon fa fa-search-plus bigger-130'></i></a></td>";
										if(businessCode==null||businessCode==""||businessCode=="TICKET"){
											detailTrs+="<tbody class='detail-commodity'  style='display:none'><tr><th colspan='1' style='width:200px'>属性</th><th colspan='2' style='width:140px'>lmm</th><th colspan='2' style='width:140px'>xc</th><th colspan='1' style='width:140px'>tn</th><th colspan='1' style='width:140px'>tc</th><th colspan='1' style='width:140px'>qnr</th><th colspan='3' style='width:140px'>mt</th></tr>"
										}else if(businessCode=="HOTEL"){
											detailTrs+="<tbody class='detail-commodity'  style='display:none'><tr><th colspan='1' style='width:200px'>属性</th><th colspan='2' style='width:140px'>lmm</th><th colspan='2' style='width:140px'>xc</th><th colspan='1' style='width:140px'>tn</th><th colspan='1' style='width:140px'>el</th><th colspan='6' style='width:140px'>qnr</th></tr>"//目前美团没有酒店
										}
										if(businessCode=="HOTEL"){
											detailTrs+="<tr><td colspan='1' style='width:200px'>房型</td><td colspan='2' style='width:140px'>"+value.commodity_name+"</td>";
											
											if(value.commodity_type_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.commodity_type_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.commodity_type_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.commodity_type_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.commodity_type_tc!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.commodity_type_tc+"</td>";
											}else if(value.commodity_type_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.commodity_type_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.commodity_type_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.commodity_type_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
										}
										detailTrs+="<tr><td colspan='1' style='width:200px'>商品名称</td><td colspan='2' style='width:140px'>"+value.commodity_name+"</td>";
										
										if(value.commodity_name_xc!=null){
											detailTrs+="<td colspan='2' style='width:125px'>"+value.commodity_name_xc+"</td>";
										}else{
											detailTrs+="<td colspan='2' style='width:125px'></td>";
										}
										if(value.commodity_name_tn!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.commodity_name_tn+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.commodity_name_tc!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.commodity_name_tc+"</td>";
										}else if(value.commodity_name_el!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.commodity_name_el+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.commodity_name_qnr!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.commodity_name_qnr+"</td>";
//											detailTrs+="<td colspan='6' style='width:140px'>"+value.commodity_name_qnr+"</td></tr>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
//											detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
										}
										//美团商品名称
                                        if(value.commodity_name_mt!=null){
                                            detailTrs+="<td colspan='3' style='width:125px'>"+value.commodity_name_mt+"</td></tr>";
                                        }else{
                                            detailTrs+="<td colspan='3' style='width:125px'></td></tr>";
                                        }

										//提前条件
										if(businessCode==null || businessCode=="" || businessCode=="TICKET"){
											detailTrs+="<tr><td colspan='1' style='width:200px'>提前条件</td><td colspan='2' style='width:140px'>"+value.sale_cond+"</td>";
											
											if(value.sale_cond_xc!=null){
												detailTrs+="<td colspan='2' style='width:125px'>"+value.sale_cond_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:125px'></td>";
											}
											if(value.sale_cond_tn!=null){
												detailTrs+="<td colspan='1' style='width:125px'>"+value.sale_cond_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:125px'></td>";
											}
											if(value.sale_cond_tc!=null){
												detailTrs+="<td colspan='1' style='width:125px'>"+value.sale_cond_tc+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:125px'></td>";
											}
											if(value.sale_cond_qnr!=null){
												detailTrs+="<td colspan='1' style='width:125px'>"+value.sale_cond_qnr+"</td>";
//												detailTrs+="<td colspan='6' style='width:140px'>"+value.sale_cond_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='1' style='width:125px'></td>";
//												detailTrs+="<td colspan='3' style='width:140px'></td></tr>";
											}
											//新增美团提前条件
                                            if(value.sale_cond_mt!=null){
                                                detailTrs+="<td colspan='3' style='width:125px'>"+value.sale_cond_mt+"</td></tr>";
                                            }else{
                                                detailTrs+="<td colspan='3' style='width:125px'></td></tr>";
                                            }
										}
										//退改条件
										if(value.refund_cond!=null){
											detailTrs+="<tr'><td colspan='1' style='width:200px'>是否可退</td><td colspan='2' style='width:140px'>"+value.refund_cond+"</td>";
										}else{
											detailTrs+="<tr'><td colspan='1' style='width:200px'>是否可退</td><td colspan='2' style='width:140px'></td>";
										}
										if(value.refund_cond_xc!=null){
											detailTrs+="<td colspan='2' style='width:125px'>"+value.refund_cond_xc+"</td>";
										}else{
											detailTrs+="<td colspan='2' style='width:125px'></td>";
										}
										if(value.refund_cond_tn!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.refund_cond_tn+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.refund_cond_tc!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.refund_cond_tc+"</td>";
										}else if(value.refund_cond_el!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.refund_cond_el+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.refund_cond_qnr!=null){
                                            detailTrs+="<td colspan='1' style='width:125px'>"+value.refund_cond_qnr+"</td>";
//                                            detailTrs+="<td colspan='6' style='width:140px'>"+value.refund_cond_qnr+"</td></tr>";
                                        }else{
//                                            detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
                                            detailTrs+="<td colspan='1' style='width:125px'></td>";
                                        }
                                        //新增美团退改条件
                                        if(value.refund_cond_mt!=null){
                                            detailTrs+="<td colspan='3' style='width:125px'>"+value.refund_cond_mt+"</td></tr>";
                                        }else{
                                            detailTrs+="<td colspan='3' style='width:125px'></td></tr>";
                                        }
										if(businessCode=="HOTEL"){
											//面积
											if(value.area!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>面积</td><td colspan='2' style='width:140px'>"+value.area+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>面积</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.area_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.area_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.area_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.area_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.area_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.area_el+"</td>";
											}else if(value.area_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.area_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.area_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.area_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
											//楼层
											if(value.floor!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>楼层</td><td colspan='2' style='width:140px'>"+value.floor+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>楼层</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.floor_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.floor_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.floor_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.floor_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.floor_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.floor_el+"</td>";
											}else if(value.floor_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.floor_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.floor_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.floor_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
											//床型
											if(value.bed_type!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>床型</td><td colspan='2' style='width:140px'>"+value.bed_type+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>床型</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.bed_type_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.bed_type_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.bed_type_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.bed_type_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.bed_type_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.bed_type_el+"</td>";
											}else if(value.bed_type_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.bed_type_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.bed_type_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.bed_type_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
											//早餐
											if(value.breadfast!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>早餐</td><td colspan='2' style='width:140px'>"+value.breadfast+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>早餐</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.breadfast_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.breadfast_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.breadfast_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.breadfast_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.breadfast_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.breadfast_el+"</td>";
											}else if(value.breadfast_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.breadfast_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.breadfast_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.breadfast_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
											//宽带
											if(value.broadband!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>宽带</td><td colspan='2' style='width:140px'>"+value.broadband+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>宽带</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.broadband_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.broadband_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.broadband_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.broadband_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.broadband_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.broadband_el+"</td>";
											}else if(value.broadband_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.broadband_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.broadband_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.broadband_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
											//窗户
											if(value.window!=null){
												detailTrs+="<tr><td colspan='1' style='width:200px'>窗户</td><td colspan='2' style='width:140px'>"+value.window+"</td>";
											}else{
												detailTrs+="<tr><td colspan='1' style='width:200px'>窗户</td><td colspan='2' style='width:140px'></td>";
											}
											if(value.window_xc!=null){
												detailTrs+="<td colspan='2' style='width:140px'>"+value.window_xc+"</td>";
											}else{
												detailTrs+="<td colspan='2' style='width:140px'></td>";
											}
											if(value.window_tn!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.window_tn+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.window_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.window_el+"</td>";
											}else if(value.window_el!=null){
												detailTrs+="<td colspan='1' style='width:140px'>"+value.window_el+"</td>";
											}else{
												detailTrs+="<td colspan='1' style='width:140px'></td>";
											}
											if(value.window_qnr!=null){
												detailTrs+="<td colspan='6' style='width:140px'>"+value.window_qnr+"</td></tr>";
											}else{
												detailTrs+="<td colspan='6' style='width:140px'></td></tr>";
											}
										}
										//优惠
										if(value.preferential_info!=null){
											detailTrs+="<tr><td colspan='1' style='width:200px'>优惠</td><td colspan='2' style='width:140px'>"+value.preferential_info+"</td>";
										}else{
											detailTrs+="<tr><td colspan='1' style='width:200px'>优惠</td><td colspan='2' style='width:140px'></td>";
										}
										if(value.preferential_info_xc!=null){
											detailTrs+="<td colspan='2' style='width:125px'>"+value.preferential_info_xc+"</td>";
										}else{
											detailTrs+="<td colspan='2' style='width:125px'></td>";
										}
										if(value.preferential_info_tn!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.preferential_info_tn+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.preferential_info_tc!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.preferential_info_tc+"</td>";
										}else if(value.preferential_info_el!=null){
											detailTrs+="<td colspan='1' style='width:125px'>"+value.preferential_info_el+"</td>";
										}else{
											detailTrs+="<td colspan='1' style='width:125px'></td>";
										}
										if(value.preferential_info_qnr!=null){
                                            detailTrs+="<td colspan='1' style='width:125px'>"+value.preferential_info_qnr+"</td>";
//                                            detailTrs+="<td colspan='6' style='width:140px'>"+value.preferential_info_qnr+"</td></tr></tbody>";
                                        }else{
                                            detailTrs+="<td colspan='1' style='width:125px'></td>";
                                        }
                                        //新增美团优惠
                                        if(value.preferential_info_mt!=null){
                                            detailTrs+="<td colspan='3' style='width:125px'>"+value.preferential_info_mt+"</td></tr></tbody>";
                                        }else{
                                            detailTrs+="<td colspan='3' style='width:125px'></td></tr></tbody>";
                                        }
										
										trs+=detailTrs;
										tbody+=trs;
									});
								table+=tbody;
								table+="</tbody>";
								table+="</table></div>"
									$("#commodityDetail").append(table);
								}
							}
						}
						
					}
				});
			}
		</script>
		<script src="${request.contextPath}/static/javascripts/g2.js"></script>
		<script src="${request.contextPath}/static/javascripts/slider.js"></script>
		<script src="${request.contextPath}/static/javascripts/g2-modal.js"></script>
		<script type="text/javascript">                                           
		
        var showlistcontext = $("#showlistcontext").val();
      //按钮改为中文、页面全局有效
        bootbox.setDefaults("locale","zh_CN");
        showPriceList=function(obj){
			$("#update").click();
			chooseTime = $("#config-demo").val();
			commodityId=$(obj).parents("tr").children("td:eq(0)").attr("class");
			$("#commodityId").val(commodityId);
			setTimeout(function(){
				$("#ajax_search").click();
			},500)
			;
		}
        
		function searchData(){
			productId=$("#setAdLowestProductId").val();
			commodityId=$("#commodityId").val();
			chooseTime = $("#config-demo").val();
			businessCode=$("#businessCodeSearch").val();
			$.ajax({
				url : showlistcontext+'/datashow/commodityPriceHistory',
				type : "GET",
				data : {
					productId:productId,
					commodityId:commodityId,
					chooseTime:chooseTime,
					businessCode:businessCode
				},
				success:function(data){
					if(data.sessionStatus==540){//异步请求session过期状态
						window.location.href=showlistcontext+"/login";
						return;
					}else{
						var data=data.priceData;	
						var defs = {
								'time':{
									type: 'time',
									tickCount: 7,
									mask:"yyyy.mm.dd"
								}
							};
						lineChartModal(data,"main","time","amount","category","","",350,defs);
					}
				}
			});
		}
		
		skipToScreenDemo=function(obj){
			productId=$(obj).parents("tr").find(".tdProductId").text().trim();
			
			productIdVO=$("#productIdVO").val();
			sceneryName=$("#sceneryNameVO").val();
			cityCode=$("#cityCodeVO").val();
			starLevel=$("#starLevelVO").val();
			location.href=showlistcontext+"/datashow/screenDemo?productId="+productId+"&sceneryName="+sceneryName+"&prodPageNum="+$("#prodPageNum").val()+
					"&cityCode="+cityCode+"&starLevel="+starLevel+"&productIdVO="+productIdVO;
			
		}
		
		deleteLowest=function(obj){
			commodity_id=$(obj).parents("tr").children("td:eq(0)").attr("class");
			prod_id=$("#setAdLowestProductId").val();
			priceRange=parseFloat($("#priceRange").val());
			 
			bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>是否还原？</strong>", function(result){
				if(result){
					$.ajax({
						url : showlistcontext+'/datashow/deleteLowest',
						type : "GET",
						data : {
							commodity_id:commodity_id,
							prod_id:prod_id
						},
						success:function(data){
							if(data.sessionStatus==540){//异步请求session过期状态
								window.location.href=showlistcontext+"/login";
								return;
							}else{
								prod=data.prodPrice;
								lmmPrice=prod.lowest_price;
								xcPrice=prod.lowest_price_xc;
								tnPrice=prod.lowest_price_tn;
								tcPrice=prod.lowest_price_tc;
								qnrPrice=prod.lowest_price_qnr;
								mtPrice=prod.lowest_price_mt;//增加美团的删除
								$("#"+prod_id+" .productDetail").find("td.lmm strong").text("").text("￥"+lmmPrice);
								if(xcPrice!=null){
									var str="";
									if(xcPrice<=lmmPrice*(1+priceRange)&&xcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=xcPrice){
										str="<div style='background-color:#67aef5;color:#fff;'>￥"+xcPrice+"</div>";
										
									}else if(lmmPrice==xcPrice){
										str="<div>￥"+xcPrice+"</div>";
									}else if(xcPrice>lmmPrice*(1+priceRange)){
										str="<div style='background-color:#84db56;color:#fff;'>￥"+xcPrice+"↑</div>";
									}else{
										str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+xcPrice+"↓</div>";
									}
									$("#"+prod_id+" .productDetail").find("td.xc strong").text("").append(str);
								}else{
									$("#"+prod_id+" .productDetail").find("td.xc strong").text("").append("<div></div>");
								}
								if(tnPrice!=null){
									var str="";
									if(tnPrice<=lmmPrice*(1+priceRange)&&tnPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tnPrice){
										str="<div style='background-color:#67aef5;color:#fff;'>￥"+tnPrice+"</div>";
										
									}else if(lmmPrice==tnPrice){
										str="<div>￥"+tnPrice+"</div>";
									}else if(tnPrice>lmmPrice*(1+priceRange)){
										str="<div style='background-color:#84db56;color:#fff;'>￥"+tnPrice+"↑</div>";
									}else{
										str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tnPrice+"↓</div>";
									}
									$("#"+prod_id+" .productDetail").find("td.tn strong").text("").append(str);
								}else{
									$("#"+prod_id+" .productDetail").find("td.tn strong").text("").append("<div></div>");
								}
								if(tcPrice!=null){
									var str="";
									if(tcPrice<=lmmPrice*(1+priceRange)&&tcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tcPrice){
										str="<div style='background-color:#67aef5;color:#fff;'>￥"+tcPrice+"</div>";
										
									}else if(lmmPrice==tcPrice){
										str="<div>￥"+tcPrice+"</div>";
									}else if(tcPrice>lmmPrice*(1+priceRange)){
										str="<div style='background-color:#84db56;color:#fff;'>￥"+tcPrice+"↑</div>";
									}else{
										str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tcPrice+"↓</div>";
									}
									$("#"+prod_id+" .productDetail").find("td.tc strong").text("").append(str);
								}else{
									$("#"+prod_id+" .productDetail").find("td.tc strong").text("").append("<div></div>");
								}
								if(qnrPrice!=null){
									var str="";
									if(qnrPrice<=lmmPrice*(1+priceRange)&&qnrPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=qnrPrice){
										str="<div style='background-color:#67aef5;color:#fff;'>￥"+qnrPrice+"</div>";
										
									}else if(lmmPrice==qnrPrice){
										str="<div>￥"+qnrPrice+"</div>";
									}else if(qnrPrice>lmmPrice*(1+priceRange)){
										str="<div style='background-color:#84db56;color:#fff;'>￥"+qnrPrice+"↑</div>";
									}else{
										str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+qnrPrice+"↓</div>";
									}
									$("#"+prod_id+" .productDetail").find("td.qnr strong").text("").append(str);
								}else{
									$("#"+prod_id+" .productDetail").find("td.qnr strong").text("").append("<div></div>");
								}

                                if(mtPrice!=null){//美团
                                    var str="";
                                    if(mtPrice<=lmmPrice*(1+priceRange)&&mtPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=mtPrice){
                                        str="<div style='background-color:#67aef5;color:#fff;'>￥"+qnrPrice+"</div>";

                                    }else if(lmmPrice==mtPrice){
                                        str="<div>￥"+mtPrice+"</div>";
                                    }else if(mtPrice>lmmPrice*(1+priceRange)){
                                        str="<div style='background-color:#84db56;color:#fff;'>￥"+mtPrice+"↑</div>";
                                    }else{
                                        str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+mtPrice+"↓</div>";
                                    }
                                    $("#"+prod_id+" .productDetail").find("td.mt strong").text("").append(str);
                                }else{
                                    $("#"+prod_id+" .productDetail").find("td.mt strong").text("").append("<div></div>");
                                }
								_obj=$(obj);
								if($(".lowestPriceOrNot span.alreadySet")!=null){
									var _this = $(".lowestPriceOrNot span.alreadySet").parent();
									$("td.lowestPriceOrNot span.alreadySet").remove();
									_this.find("span").remove();
									_this.append("<span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a title='执行' class='green' onclick='setAsLowest(this);'role='button'  data-toggle='modal'><i class='ace-icon fa fa-check bigger-120'></i></a></span>");
								}
								
								$(obj).parents("td.lowestPriceOrNot").text("").append("<span class='alreadySet'>已设</span><span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a class='red' style='float:right' onclick='deleteLowest(this);'><i class='ace-icon fa fa-trash-o bigger-130'></i></a></span>");
							}
						}
					});
				}
			}).attr("style","top:20%");
			
		};
		setAsLowest=function(obj){
			commodity_id=$(obj).parents("tr").children("td:eq(0)").attr("class");
			prod_id=$("#setAdLowestProductId").val();
			priceRange=parseFloat($("#priceRange").val());
			bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>是否确认设为产品起价？</strong>", function(result){
				if(result){
					$.ajax({
						url : showlistcontext+'/datashow/setAsLowest',
						type : "GET",
						data : {
							commodity_id:commodity_id,
							prod_id:prod_id
						},
						success:function(data){
						    console.log(data);//need delete
							if(data.sessionStatus==540){//异步请求session过期状态
								window.location.href=showlistcontext+"/login";
								return;
							}else{
							    console.log(obj);
								lmmText=$(obj).parents("tr").children("td:eq(1)").find("strong").text().trim();
								lmmPrice=parseInt(lmmText.substring(1,lmmText.length));
								$("#"+prod_id+" .productDetail").find("td.lmm strong").text("").text("￥"+lmmPrice);
								if($(obj).parents("tr").find("td.xcPrice strong")!=null){
									xcText=$(obj).parents("tr").find("td.xcPrice strong span").text().trim();
									xcPrice=parseInt(xcText);
									if(!isNaN(xcPrice))
									{
                                        var str="";
                                        if(xcPrice<=lmmPrice*(1+priceRange)&&xcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=xcPrice){
                                            str="<div style='background-color:#67aef5;color:#fff;'>￥"+xcPrice+"</div>";

                                        }else if(lmmPrice==xcPrice){
                                            str="<div>￥"+xcPrice+"</div>";
                                        }else if(xcPrice>lmmPrice*(1+priceRange)){
                                            str="<div style='background-color:#84db56;color:#fff;'>￥"+xcPrice+"↑</div>";
                                        }else{
                                            str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+xcPrice+"↓</div>";
                                        }
                                        $("#"+prod_id+" .productDetail").find("td.xc strong").text("").append(str);
									}

								}else{
									xcText=$("#"+prod_id+" .productDetail").find("td.xc strong").text();
									if(xcText!=null){
										xcPrice=xcText.match(/\d+/);
										if(!isNaN(xcPrice))
										{
                                            var str="";
                                            if(xcPrice<=lmmPrice*(1+priceRange)&&xcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=xcPrice){
                                                str="<div style='background-color:#67aef5;color:#fff;'>￥"+xcPrice+"</div>";

                                            }else if(lmmPrice==xcPrice){
                                                str="<div>￥"+xcPrice+"</div>";
                                            }else if(xcPrice>lmmPrice*(1+priceRange)){
                                                str="<div style='background-color:#84db56;color:#fff;'>￥"+xcPrice+"↑</div>";
                                            }else{
                                                str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+xcPrice+"↓</div>";
                                            }
                                            $("#"+prod_id+" .productDetail").find("td.xc strong").text("").append(str);
										}

									}
									
								}
								if($(obj).parents("tr").find("td.tnPrice strong")!=null){
									tnText=$(obj).parents("tr").find("td.tnPrice strong span").text().trim();
									tnPrice=parseInt(tnText);
									if(!isNaN(tnPrice))
									{
                                        var str="";
                                        if(tnPrice<=lmmPrice*(1+priceRange)&&tnPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tnPrice){
                                            str="<div style='background-color:#67aef5;color:#fff;'>￥"+tnPrice+"</div>";

                                        }else if(lmmPrice==tnPrice){
                                            str="<div>￥"+tnPrice+"</div>";
                                        }else if(tnPrice>lmmPrice*(1+priceRange)){
                                            str="<div style='background-color:#84db56;color:#fff;'>￥"+tnPrice+"↑</div>";
                                        }else{
                                            str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tnPrice+"↓</div>";
                                        }
                                        $("#"+prod_id+" .productDetail").find("td.tn strong").text("").append(str);
									}

								}else{
									tnText=$("#"+prod_id+" .productDetail").find("td.tn strong").text();
									if(tnText!=null){
										tnprice=tnText.match(/\d+/);
										if(!isNaN(tnprice))
										{
                                            var str="";
                                            if(tnPrice<=lmmPrice*(1+priceRange)&&tnPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tnPrice){
                                                str="<div style='background-color:#67aef5;color:#fff;'>￥"+tnPrice+"</div>";
                                            }else if(lmmPrice==tnPrice){
                                                str="<div>￥"+tnPrice+"</div>";
                                            }else if(tnPrice>lmmPrice*(1+priceRange)){
                                                str="<div style='background-color:#84db56;color:#fff;'>￥"+tnPrice+"↑</div>";
                                            }else{
                                                str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tnPrice+"↓</div>";
                                            }
                                            $("#"+prod_id+" .productDetail").find("td.tn strong").text("").append(str);
										}

									}
									
								}
								if($(obj).parents("tr").find("td.tcPrice strong")!=null){
									tcText=$(obj).parents("tr").find("td.tcPrice strong span").text().trim();
									tcPrice=parseInt(tcText);
									if(!isNaN(tcPrice))
									{
                                        var str="";
                                        if(tcPrice<=lmmPrice*(1+priceRange)&&tcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tcPrice){
                                            str="<div style='background-color:#67aef5;color:#fff;'>￥"+tcPrice+"</div>";

                                        }else if(lmmPrice==tcPrice){
                                            str="<div>￥"+tcPrice+"</div>";
                                        }else if(tcPrice>lmmPrice*(1+priceRange)){
                                            str="<div style='background-color:#84db56;color:#fff;'>￥"+tcPrice+"↑</div>";
                                        }else{
                                            str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tcPrice+"↓</div>";
                                        }
                                        $("#"+prod_id+" .productDetail").find("td.tc strong").text("").append(str);
									}

								}else{
									tcText=$("#"+prod_id+" .productDetail").find("td.tc strong").text();
									if(tcText!=null){
										tcPrice=tcText.match(/\d+/);
										if(!isNaN(tcPrice))
										{
                                            var str="";
                                            if(tcPrice<=lmmPrice*(1+priceRange)&&tcPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=tcPrice){
                                                str="<div style='background-color:#67aef5;color:#fff;'>￥"+tcPrice+"</div>";

                                            }else if(lmmPrice==tcPrice){
                                                str="<div>￥"+tcPrice+"</div>";
                                            }else if(tcPrice>lmmPrice*(1+priceRange)){
                                                str="<div style='background-color:#84db56;color:#fff;'>￥"+tcPrice+"↑</div>";
                                            }else{
                                                str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+tcPrice+"↓</div>";
                                            }
                                            $("#"+prod_id+" .productDetail").find("td.tc strong").text("").append(str);
										}

									}
									
								}
								if($(obj).parents("tr").find("td.qnrPrice strong")!=null){
									qnrText=$(obj).parents("tr").find("td.qnrPrice strong span").text().trim();
									qnrPrice=parseInt(qnrText);
									if(!isNaN(qnrPrice))
									{
                                        var str="";
                                        if(qnrPrice<=lmmPrice*(1+priceRange)&&qnrPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=qnrPrice){
                                            str="<div style='background-color:#67aef5;color:#fff;'>￥"+qnrPrice+"</div>";

                                        }else if(lmmPrice==qnrPrice){
                                            str="<div>￥"+qnrPrice+"</div>";
                                        }else if(qnrPrice>lmmPrice*(1+priceRange)){
                                            str="<div style='background-color:#84db56;color:#fff;'>￥"+qnrPrice+"↑</div>";
                                        }else{
                                            str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+qnrPrice+"↓</div>";
                                        }
                                        $("#"+prod_id+" .productDetail").find("td.qnr strong").text("").append(str);
									}

								}else{
									qnrText=$("#"+prod_id+" .productDetail").find("td.qnr strong").text();
									if(qnrText!=null){
										qnrPrice=qnrText.match(/\d+/);
										if(!isNaN(qnrPrice))
										{
                                            var str="";
                                            if(qnrPrice<=lmmPrice*(1+priceRange)&&qnrPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=qnrPrice){
                                                str="<div style='background-color:#67aef5;color:#fff;'>￥"+qnrPrice+"</div>";

                                            }else if(lmmPrice==qnrPrice){
                                                str="<div>￥"+qnrPrice+"</div>";
                                            }else if(qnrPrice>lmmPrice*(1+priceRange)){
                                                str="<div style='background-color:#84db56;color:#fff;'>￥"+qnrPrice+"↑</div>";
                                            }else{
                                                str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+qnrPrice+"↓</div>";
                                            }
                                            $("#"+prod_id+" .productDetail").find("td.qnr strong").text("").append(str);
										}

									}
									
								}

								//新增美团

                                if($(obj).parents("tr").find("td.mtPrice strong")!=null){
                                    mtText=$(obj).parents("tr").find("td.mtPrice strong span").text().trim();
                                    mtPrice=parseInt(mtText);
                                    var str="";
                                    if(!isNaN(mtPrice))
									{
                                        if(mtPrice<=lmmPrice*(1+priceRange)&&qnrPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=mtPrice){
                                            str="<div style='background-color:#67aef5;color:#fff;'>￥"+mtPrice+"</div>";

                                        }else if(lmmPrice==mtPrice){
                                            str="<div>￥"+mtPrice+"</div>";
                                        }else if(mtPrice>lmmPrice*(1+priceRange)){
                                            str="<div style='background-color:#84db56;color:#fff;'>￥"+mtPrice+"↑</div>";
                                        }else{
                                            str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+mtPrice+"↓</div>";
                                        }
                                        $("#"+prod_id+" .productDetail").find("td.mt strong").text("").append(str);
									}

                                }else{
                                    mtText=$("#"+prod_id+" .productDetail").find("td.mt strong").text();
                                    if(mtText!=null){
                                        mtPrice=mtText.match(/\d+/);
                                        if(!isNaN(mtPrice))
										{
                                            var str="";
                                            if(mtPrice<=lmmPrice*(1+priceRange)&&mtPrice>=lmmPrice*(1-priceRange)&&lmmPrice!=mtPrice){
                                                str="<div style='background-color:#67aef5;color:#fff;'>￥"+mtPrice+"</div>";

                                            }else if(lmmPrice==mtPrice){
                                                str="<div>￥"+mtPrice+"</div>";
                                            }else if(mtPrice>lmmPrice*(1+priceRange)){
                                                str="<div style='background-color:#84db56;color:#fff;'>￥"+mtPrice+"↑</div>";
                                            }else{
                                                str="<div style='background-color:#ed6d5c;color:#fff;'>￥"+mtPrice+"↓</div>";
                                            }
                                            $("#"+prod_id+" .productDetail").find("td.mt strong").text("").append(str);
										}

                                    }

                                }

								_obj=$(obj);
								if($(".lowestPriceOrNot span.alreadySet")!=null){
									var _this = $(".lowestPriceOrNot span.alreadySet").parent();
									$("td.lowestPriceOrNot span.alreadySet").remove();
									_this.find("span").remove();
									_this.append("<span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a title='执行' class='green' onclick='setAsLowest(this);'role='button'  data-toggle='modal'><i class='ace-icon fa fa-check bigger-120'></i></a></span>");
								}
								
								$(obj).parents("td.lowestPriceOrNot").text("").append("<span class='alreadySet'>已设</span><span class='hidden-sm hidden-xs action-buttons' style='cursor:pointer;'><a class='red' style='float:right' onclick='deleteLowest(this);'><i class='ace-icon fa fa-trash-o bigger-130'></i></a></span>");
							}
							
							
						}
					});
				}
			}).attr("style","top:20%");
			
		}
		
		function dataScope(value1, value2) {
            var getDate = function (str) {
                var tempDate = new Date();
                var list = str.split("/");
                tempDate.setFullYear(list[2]);
                tempDate.setMonth(0);
                tempDate.setDate(list[1]);
                tempDate.setMonth(list[0] - 1);
                return tempDate;
            }
            var date1 = getDate(value1);
            var date2 = getDate(value2);
            if (date1 > date2) {
                var tempDate = date1;
                date1 = date2;
                date2 = tempDate;
            }
            date1.setDate(date1.getDate());
            var dateArr = [];
            var i = 0;
            while (!(date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate() + 1)) {
                dateArr[i] = date1.getFullYear()+"-"+((date1.getMonth() + 1) < 10 ? ('0' + (date1.getMonth() + 1)) : (date1.getMonth() + 1))+ "-" 
                        + (date1.getDate() < 10 ? ('0' + (date1.getDate())) : (date1.getDate()));
                i++;
                date1.setDate(date1.getDate() + 1);
                if(date1 >= date2)
               	{
               		break;
               	}
            }
            return dateArr;
        }	
		showComDetailInfo=function(obj){
			$(obj).closest('tbody').next().toggle();
			$(obj).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass('fa-angle-double-up');
		}

		function replaceDate(obj){
    		if(obj == '7'){
    			startDate = new Date(new Date().getTime()-7*1000*60*60*24);
	    		endDate = new Date(new Date().getTime()-1*1000*60*60*24);
    		}else if(obj == '31'){
    			startDate = new Date(new Date().getTime()-31*1000*60*60*24);
	    		endDate = new Date(new Date().getTime()-1*1000*60*60*24);
    		}
		 	var dateStr = dateFormat(startDate) + " - " + dateFormat(endDate);
		    $(".time").val(dateStr);
    	}
		function dateFormat(date){
    		var month = date.getMonth() + 1;
		    var strDate = date.getDate();
		    if (month >= 1 && month <= 9) {
		        month = "0" + month;
		    }
		    if (strDate >= 0 && strDate <= 9) {
		        strDate = "0" + strDate;
		    }
		    var currentdate = month + "/" + strDate + "/" + date.getFullYear();
		    return currentdate;
    	}
		function echartGetDate(str) {
            var tempDate = new Date();
            var list = str.split("/");
            tempDate.setFullYear(list[2]);
            tempDate.setMonth(list[0] - 1);
            tempDate.setDate(list[1]);
            return tempDate;
        }
		$('.time').daterangepicker(
				{
					startDate: new Date(new Date().getTime()-31*1000*60*60*24),
				    endDate: new Date(new Date().getTime()),
					showDropdowns : true,
					showWeekNumbers : false,
					timePicker : false,
					timePicker12Hour : false,
					ranges : {
		            	'过去7天': [moment().subtract(7, 'days'), moment().subtract(1, 'days')],
		                '过去31天': [moment().subtract(31, 'days'), moment().subtract(1, 'days')] 
					},
					opens : 'right',
					buttonClasses : [ 'btn btn-default' ],
					applyClass : 'btn-small btn-pink blue',
					cancelClass : 'btn-small',
					format : 'yyyy-MM-dd',
					separator : ' to ',
					locale : {
						applyLabel : '确定',
						cancelLabel : '取消',
						fromLabel : '起始时间',
						toLabel : '结束时间',
						customRangeLabel : '自定义',
						daysOfWeek : [ '日', '一', '二', '三', '四', '五',
								'六' ],
						monthNames : [ '一月', '二月', '三月', '四月', '五月',
								'六月', '七月', '八月', '九月', '十月', '十一月',
								'十二月' ],
						firstDay : 1
					}
				},
				function(start, end, label) {//格式化日期显示框

					$('.time').html(
							start.format('yyyy-MM-dd') + ' - '
									+ end.format('yyyy-MM-dd'));
				});
		
		</script>
	</body>
</html>